﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PersonalWebsite.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class init7 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_TgaGame",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(7175),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 70, DateTimeKind.Local).AddTicks(9205),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_Show",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(5701),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 70, DateTimeKind.Local).AddTicks(4773),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_ProExperience",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 659, DateTimeKind.Local).AddTicks(1479),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 68, DateTimeKind.Local).AddTicks(6606),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_HotMovie",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(4236),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 70, DateTimeKind.Local).AddTicks(186),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_GameVideo",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(2811),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 69, DateTimeKind.Local).AddTicks(5977),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_Book",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(1069),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 69, DateTimeKind.Local).AddTicks(1739),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_Ability",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 658, DateTimeKind.Local).AddTicks(9884),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 68, DateTimeKind.Local).AddTicks(1605),
                oldComment: "创建时间");

            migrationBuilder.CreateTable(
                name: "WP_Post",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Title = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Category = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false, comment: "类型")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Desc = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "描述")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Tags = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "标签")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Time = table.Column<string>(type: "varchar(255)", nullable: true, defaultValue: "03/12/2025 19:32:13", comment: "发布时间")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsOutlink = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: true, comment: "是否外部连接"),
                    LinkUrl = table.Column<string>(type: "varchar(300)", unicode: false, maxLength: 300, nullable: true, comment: "外部链接地址")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    DeleteTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "删除时间"),
                    IsDeleted = table.Column<int>(type: "int", nullable: false, defaultValue: 0, comment: "删除标识"),
                    DeletorId = table.Column<int>(type: "int", nullable: true, comment: "删除人"),
                    CreatorId = table.Column<int>(type: "int", nullable: false, comment: "创建人"),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, defaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(9746), comment: "创建时间"),
                    EditorId = table.Column<int>(type: "int", nullable: true, comment: "编辑人"),
                    EditorTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "编辑时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WP_Post", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateIndex(
                name: "IX_WP_Post_Category",
                table: "WP_Post",
                column: "Category");

            migrationBuilder.CreateIndex(
                name: "IX_WP_Post_Time",
                table: "WP_Post",
                column: "Time");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "WP_Post");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_TgaGame",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 70, DateTimeKind.Local).AddTicks(9205),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(7175),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_Show",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 70, DateTimeKind.Local).AddTicks(4773),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(5701),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_ProExperience",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 68, DateTimeKind.Local).AddTicks(6606),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 659, DateTimeKind.Local).AddTicks(1479),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_HotMovie",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 70, DateTimeKind.Local).AddTicks(186),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(4236),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_GameVideo",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 69, DateTimeKind.Local).AddTicks(5977),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(2811),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_Book",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 69, DateTimeKind.Local).AddTicks(1739),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 660, DateTimeKind.Local).AddTicks(1069),
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "WS_Ability",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(2025, 3, 12, 19, 3, 41, 68, DateTimeKind.Local).AddTicks(1605),
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldDefaultValue: new DateTime(2025, 3, 12, 19, 32, 13, 658, DateTimeKind.Local).AddTicks(9884),
                oldComment: "创建时间");
        }
    }
}
